package com.shunbo.convenient.controller;

import com.shunbo.convenient.service.LogService;
import com.shunbo.convenient.utils.ConvenientResult;
import com.shunbo.convenient.vo.Log;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author weizhuang
 * log
 */
@RestController
@RequestMapping("/log")
public class LogController {


    @Resource
    private LogService logService;


    /**
     * 查看log列表
     *
     * @param log 收货地址
     * @return Result结果集
     */
    @RequestMapping("/list")
    public ConvenientResult getLogList(@RequestBody Log log) {
        try {
            List<Log> all = logService.findAll(log);
            return ConvenientResult.build(200, "成功", all);
        } catch (Exception e) {
            e.printStackTrace();
            return ConvenientResult.build(500, "系统错误", e.getStackTrace());
        }
    }


}
